
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, OmitType, IntersectionType } from '@nestjs/swagger';
import { PagingDto } from 'src/common/dto/index';
import { CharEnum } from 'src/common/enum/index';
import {JoinColumn, ManyToOne} from "typeorm";
import {ProfessionalEntity} from "../../professional/entities/professional.entity";
import {SchoolEntity} from "../../school/entities/school.entity";
import {CampusEntity} from "../../campus/entities/campus.entity";


export class BaseClassDto{
	@ApiProperty({required: false , description: '班级ID'})
	@IsOptional()
	classId?: number;

	@ApiProperty({enum: CharEnum, required: false , description: '删除标志'})
	@IsOptional()
	delFlag?: string;

	@ApiProperty({enum: CharEnum, required: false , description: '状态'})
	@IsOptional()
	status?: string;

	@ApiProperty({required: false , description: '创建者'})
	@IsOptional()
	createBy?: string;

	@ApiProperty({required: false , description: '创建时间'})
	@IsOptional()
	createTime?: string;

	@ApiProperty({required: false , description: '更新者'})
	@IsOptional()
	updateBy?: string;

	@ApiProperty({required: false , description: '更新时间'})
	@IsOptional()
	updateTime?: string;

	@ApiProperty({required: false , description: '备注'})
	@IsOptional()
	remark?: string;

	@ApiProperty({required: false , description: '班级名称'})
	@IsOptional()
	className?: string;

	@ApiProperty({required: false , description: '入学时间'})
	@IsOptional()
	entryDate?: string;

	@ApiProperty({required: false , description: '归属学校'})
	@IsOptional()
	schoolId?: number;

	@ApiProperty({required: false , description: '归属校区'})
	@IsOptional()
	campusId?: number;

	@ApiProperty({required: false , description: '班主任'})
	@IsOptional()
	managerId?: number;

	@ApiProperty({required: false , description: '关联专业'})
	@IsOptional()
	proId?: number;



}

export class CreateClassDto extends OmitType(BaseClassDto, [ 'classId', 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']){}

export class UpdateClassDto extends OmitType(BaseClassDto, [ 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']){}

export class QueryClassDto extends IntersectionType( BaseClassDto, PagingDto){}

export class ListClassDto  extends OmitType(BaseClassDto, [ 'classId', 'delFlag', 'createBy', 'createTime', 'updateBy', 'updateTime']) {}
